//
//  ProphesyDetailViewController.m
//  WuLi
//
//  Created by Gollum on 16/9/7.
//  Copyright © 2016年 Gollum. All rights reserved.
//

#import "ProphesyDetailViewController.h"
#import "NetworkTool.h"
#import "YYAnimationView.h"
@interface ProphesyDetailViewController ()
@property (weak, nonatomic) IBOutlet UIWebView *webView;

@end

@implementation ProphesyDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    [self handleData];
    // Do any additional setup after loading the view from its nib.
    NSLog(@"%@",_detailLinkString);
    
    NSURL *url = [NSURL URLWithString:_detailLinkString];
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
    [_webView loadRequest:request];
    _webView.scrollView.bounces = NO;
    
}
- (void)handleData{
    
    NSString *urlString = _detailLinkString;
    
    NSDictionary *header = @{@"User-Agent":@"Dalvik/2.1.0 (Linux; U; Android 5.0; ASUS_Z00ADB Build/LRX21V) Wuli/2.3.1 (agent:s;channel:wandoujia;credential:e1MyMDEwMDAxMDF9LXsjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIzM1Nzg3MjA2MTcxNDM4M30teyMjIyMjIyMxNDcyMDAyMTMyOTYzLTJlZjRjNThjZDJ9QDE0NzExODgxOTgzODY=;deviceId:357872061714383;osTypeId:01;detailInfo:android;simTypeId:01;netTypeId:01;deviceTypeId:01;osVersion:5.0;idfa:null)", @"Host":@"api.5wuli.com"};
    
    [NetworkTool GET:urlString andBody:nil andHeader:header andResponse:JHJSON andSuccessBlock:^(id result) {
        
                NSLog(@"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%@",result);
        
        
    } andFailureBlock:^(NSError *error) {
        
    }];
    
    
}
- (IBAction)handleBack:(id)sender {
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}
- (IBAction)shareButton:(id)sender {
    [self showAnimationView];
}
- (void)showAnimationView
{
    NSArray *imgNameArray = @[@"朋友圈"
                              ,@"微信"
                              ,@"QQ"
                              ,@"QQ空间"
                              ,@"新浪微博"
                              ,@"复制链接"
                              , @"收藏-1"
                              ,@"字体设置"
                              ,@"举报"
                              ,@"夜间模式"
                              ];
    
    NSArray *titleArray = @[@"朋友圈"
                            ,@"微信"
                            ,@"QQ"
                            ,@"QQ空间"
                            ,@"新浪微博"
                            ,@"复制链接",
                            @"收藏-1",
                            @"字体设置",
                            @"举报",
                            @"夜间模式"
                            ];
    YYAnimationView *animationView = [[YYAnimationView alloc] initImageNameArray:imgNameArray withItmeTitleArray:titleArray];
    animationView.lineItmeNumber = 3;
    animationView.itmeSize = CGSizeMake(100, 100);
    animationView.itmeTitleFont = [UIFont systemFontOfSize:15];
    [animationView addButtonItmeToAnimationView];
    [animationView showAnimationView];
    animationView.yyAnimationButtonItmeClick = ^( NSInteger tags){
        NSLog(@"%ld",(long)tags);
    };
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
